package com.lolong.hic;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.Toast;

public class MainActivity extends Activity implements OnClickListener {

	private Button startBtn, howBtn, aboutBtn;

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		initComponents();
	}

	public void initComponents() {

		setContentView(R.layout.activity_main);

		startBtn = (Button) findViewById(R.id.startButton);
		startBtn.setOnClickListener(this);

		howBtn = (Button) findViewById(R.id.howButton);
		howBtn.setOnClickListener(this);

		aboutBtn = (Button) findViewById(R.id.aboutButton);
		aboutBtn.setOnClickListener(this);
	}

	@Override
	public boolean onCreateOptionsMenu(Menu menu) {
		// Inflate the menu; this adds items to the action bar if it is present.
		getMenuInflater().inflate(R.menu.activity_main, menu);
		return true;
	}

	@Override
	public void onClick(View v) {

		switch (v.getId()) {

		case R.id.startButton:
			Intent intent = new Intent(MainActivity.this, CategoryActivity.class);
			startActivity(intent);
			break;

		case R.id.howButton:
			intent = new Intent(MainActivity.this, InstructionActivity.class);
			startActivity(intent);
			break;

		case R.id.aboutButton:
			intent = new Intent(MainActivity.this, AboutActivity.class);
			startActivity(intent);
			break;
		}
	}
}
